<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>我要借入</title>
		<link rel="stylesheet" type="text/css" th:href="@{/css/base.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/index.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/message.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
		<!--[if lt IE 9]>
			<script th:src=" @{/js/html5shiv.js}"></script>
		<![endif]-->
	</head>
	<body>
		<div class="header_bg">
			<header>
				<a class="logo" href="#">
					<img th:src="@{/images/logo.png}"/>
				</a>
				<ul id="nav">
					<li><a href="/jump?pg=index ">首页</a><span class="ul-img"></span></li>
					<li><a href="/jump?pg=borrow_home_page ">我要借出</a><span></span></li>
					<li><a href="/jump?pg=account_fund_management ">我要借入</a><span></span></li>
					<li><a href="/jump?pg=personal_center ">我的账户</a><span></span></li>
					<li><a href="/jump?pg=help_center ">帮助</a><span></span></li>
					<li><a href="/jump?pg=news ">社区</a><span></span></li>
					<li><a href="/jump?pg=authentication ">本金保障</a><span></span></li>
				</ul>
				
				<div id="unentry_status">
				<a href="/jump?pg=entry " id="header_entry">登录</a>
				<a href="/jump?pg=register " id="header_register">免费注册</a>
				</div>
				
				<ul id="person_message">
					<li><a href="/jump?pg=personal_center "><span></span></a></li>
					<li><a href="/jump?pg=personal_center ">陈政</a></li>
					<li><a href="/jump?pg=message "><span></span></a></li>
					<li><a href="#"><span></span></a></li>
					<li><a id="leave" href="#">退出</a></li>
					
					<span id="person_message_num">22</span>
					
					<span id="message_setting1"></span>
					<ul id="message_setting2">
						<li>资料设置</li>
						<li>安全中心</li>
						<li>头像设置</li>
						<li>修改密码</li>
						<li>选项名称</li>
					</ul>
				</ul>
			</header>
			
			<div class="lend_out_bg">
					<div class="lend_out">
						<a href="/jump?pg=borrow_details ">发布借款</a>
						<a href="/jump?pg=borrow_interest ">利息计算器</a>
						<a href="/jump?pg=borrow_credit_rating ">个人信用借出等级</a>
						<a href="/jump?pg=lend_list_details ">借出列表详情</a>
					</div>
				</div>
			
			<div class="borrow_in_bg">
					<div class="borrow_in">
						<a href="/jump?pg=borrow_details ">查找借款</a>
						<a href="/jump?pg=borrow_interest ">利息计算器</a>
						<a href="/jump?pg=borrow_credit_rating ">个人信用借入等级</a>
						<a href="/jump?pg=borrow_repayment_treatment ">还款</a>
						<a href="/jump?pg=lend_list_details ">借入列表详情</a>
						<a href="/jump?pg=lend_list ">查找放款</a>
					</div>
				</div>
			
		</div>
		
		<div class="borrow_success_main">
			<div class="borrow_success_main_title">
				<div class="borrow_success_main_color">1</div>
				<h1>我要借入</h1>
				
			</div>
			
			<div class="borrow_success_main_attention">
					<h5>尊敬的hahd您好，您的列表已经发布成功，等待满标。请多做<span>认证</span>和<span>关联</span>，加快满标速度。</h5>
					<table id="borrow_success_main_attention_table" border="" cellspacing="" cellpadding="">
						<tr>
							<th>列表号:<span>1238123</span></th>
							<th>列表名称：<span>我要借钱</span></th>
							<th>发布时间：2013-09-20 12:00</th>
						</tr>
						<tr>
							<th>状态：<span>发表列表</span></th>
							<th>投标结束时间：2013-09-20 12:00</th>
						</tr>
					</table>
				</div>
				
		<div class="borrow_success_pic">
			<img th:src="@{/images/borrow_success_pic.png}"/>
		</div>
		
		<div class="borrow_success_content">
			<h5>为了加快您的借款速度，请尽快上传资料</h5>
			<div class="borrow_success_box">
				<div class="borrow_success_box_p1">
					<form id="uploadFiles">
					<!---->
					<div id="RightPage" class="upload_file_main" data-page="2">
						<input id="loanId" type="hidden" th:value="${loanId}">
						抵押物：	<select name="pawn" id="pawn">
						<option value="房屋">房屋</option>
						<option value="汽车">汽车</option>
						<option value="机器设备">机器设备</option>
						<option value="原材料">原材料</option>
						<option value="产品">产品</option>
						<option value="专利权">专利权</option>
						<option value="有价证券">有价证券</option>
						<option value="其他">其他</option>
					</select>
						<div class="container-fluid">
							<div class="row" id="uplodFilel">
								<div class="col-md-4">

									<img id="img0" src="" alt="抵押物产权证书" class="img-thumbnail" name="upfileUrl">
									<input id="inp0" type="file"  value="抵押物产权证书"/>
								</div>
								<div class="col-md-4">

									<img id="img1" src="" alt="上传身份证正面" name="identity1" class="img-thumbnail">
									<input id="inp1" type="file"  value="上传身份证正面"/>
								</div>
								<div class="col-md-4">
									<img id="img2" alt="上传身份证反面" name="identity2" class="img-thumbnail">
									<input id="inp2" type="file"   value="" />
								</div>
							</div>
							<div class="row" id="uplodFilel">

								<div class="col-md-4">
									<img  id="img3"  alt="上传工作证明" name="certificate" class="img-thumbnail">
									<input id="inp3"  type="file" value=""/>
								</div>

								<div class="col-md-4">
									<img id="img4"  alt="上传6个月流水" name="currentAccount" class="img-thumbnail">
									<input id="inp4"  type="file"  value=""/>
								</div>

								<div class="col-md-4">
									<img id="img5" alt="征信报告" name="creditReport" class="img-thumbnail">
									<input id="inp5"  type="file"  value=""/>
								</div>
								<!--								<div class="col-md-4">.col-md-4</div>-->
							</div>


						</div>



					</div>
<!--						<input type="submit" value="提交"/>-->

					</form>
					<button id="upFile" type="button" class="btn btn-success" style="margin-left: 400px;margin-top: 20px">确认并上传</button>
			</div>
		</div>
		</div>
		
		<div class="clear"></div>
		<div class="footer_bg2">
			<footer>
				<ul>      
					<li><a href="/jump?pg=#">常见问题</a>|</li>
					<li><a href="/jump?pg=#">媒体报道</a>|</li>
					<li><a href="/jump?pg=#">联系我们 </a>|</li>
					<li><a href="/jump?pg=#">加入我们 </a>|</li>
					<li><a href="/jump?pg=#">隐私保护</a></li>
				</ul>
				
				<p>Copyright©2013 daikuan All Rights Reserved   建智领航公司 版权所有</p>
			</footer>
		</div>
		
		<script th:src="@{/js/jquery-1.12.4.min.js}" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" th:src="@{/js/Function.js}" ></script>
		<script>
			$(function(){
				var c_start=document.cookie.indexOf('username' + "=");
				if(c_start == -1){
					$("#unentry_status").show();
					$("#person_message").hide();
				}else{
					$("#unentry_status").hide();
					$("#person_message").show();
				}


			})




			//预览效果
			$('#inp0').change(function () {
				// let inp= $('#inp0').val();
				// console.log("inp:",inp);
				var formData=new FormData();
				formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img0').attr('src',src);
							img0=src;
						}
					}
				})

				// $('#img1').attr('src',src);
			})
			$('#inp1').change(function () {
			let inp= $('#inp1').val();
			console.log("inp:",inp);
			var formData=new FormData();
			formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img1').attr('src',src);
						}
					}
				})

				// $('#img1').attr('src',src);
			})
			$('#inp2').change(function () {
				var formData=new FormData();
				formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img2').attr('src',src);
						}
					}
				})

			})
			$('#inp3').change(function () {
				var formData=new FormData();
				formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img3').attr('src',src);
						}
					}
				})

			})
			$('#inp4').change(function () {
				var formData=new FormData();
				formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img4').attr('src',src);
						}
					}
				})

			})
			$('#inp5').change(function () {
				var formData=new FormData();
				formData.append('upfile',$(this)[0].files[0]);
				$.ajax({
					url:'/uploadfile/image',
					data:formData,
					type:'post',
					processData: false,// 不处理数据
					contentType: false, // 不设置内容类型
					success(result){
						let src;
						if(result!=null){
							console.log("result:",result.data.img);
							src=result.data.img;
							$('#img5').attr('src',src);
						}
					}
				})

			})

			$('#upFile').click(function () {
				console.log('qqqq',$('#img0')[0].src);
				let pawn=$('#pawn').val();
				let img0=$('#img0')[0].src;
				let img1=$('#img1')[0].src;
				let img2=$('#img2')[0].src;
				let img3=$('#img3')[0].src;
				let img4=$('#img4')[0].src;
				let img5=$('#img5')[0].src;
				let loanId=$('#loanId').val();
				$.ajax({
					url: '/uploadfile/saveFiles',
					data:{pawn,img0,img1,img2,img3,img4,img5,loanId},
					type:'post',
					success(result){
						console.log("re",result);
						alert("上传成功")
						window.location.href='/jump?pg=account_fund_management'
						$(".borrow_list_main").show()
					}
				})
			})
		</script>
		</div>
	</body>
</html>
